//
//  HomeGoodsModel.m
//  Shengzhuli
//
//  Created by FXGuo on 2017/4/9.
//  Copyright © 2017年 kamangkeji. All rights reserved.
//

#import "HomeGoodsModel.h"
#import "HomeGoodsTypeModel.h"


@implementation HomeGoodsModel

- (instancetype)initWithDict:(NSDictionary *)dict
{
    if (self = [super init]) {
        self.type = [dict[@"type"] integerValue];
        self.recommendName = dict[@"recommendName"];
        self.productTypeName = dict[@"productTypeName"];
        self.subtitle = dict[@"subtitle"];
        self.indexActivityImage = dict[@"indexActivityImage"];
        self.productTypeParentId = [dict[@"productTypeParentId"] integerValue];
        
        NSMutableArray *arr = [NSMutableArray array];
        for (NSDictionary *reDict in dict[@"typeList"]) {
            HomeGoodsTypeModel *model = [HomeGoodsTypeModel objectWithDict:reDict];
            [arr addObject:model];
        }
        self.typeList = arr;
    }
    return self;
}

+ (instancetype)objectWithDict:(NSDictionary *)dict
{
    return [[HomeGoodsModel alloc]initWithDict:dict];
}

@end
